/**
 * A class to record enter and leave times for a Process
 * in the ready queue.
 * CS 149 Project, Phase 1
 * @author Keven Wong
 * @author Timmy Yee
 */

public class WaitingPeriod
{
    private double enterTime; // time a process enters ready queue
    private double leaveTime; // time a process leaves ready queue

    /**
     * Gets the relative time spent in one waiting period in the ready queue.
     * @return time in a waiting period
     */
    public double getTime()
    {
        return leaveTime - enterTime;
    }

    /**
     * Sets the leave time of a process in ready queue.
     * @param leaveTime - leave time of process in waiting queue
     */
    public void setLeaveTime(double leaveTime)
    {
        this.leaveTime = leaveTime;
    }

    /**
     * Constructs a record of waiting in the ready queue for a process.
     * @param enterTime - enter time of process in waiting queue
     */
    public WaitingPeriod(double enterTime)
    {
        this.enterTime = enterTime;
    }
}

